package vip.xiaonuo.smzq.modular.lifecycle.service.factory.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import vip.xiaonuo.smzq.modular.lifecycle.entity.KclWjglb;
import vip.xiaonuo.smzq.modular.lifecycle.entity.PsbaGtWjglb;
import vip.xiaonuo.smzq.modular.lifecycle.service.entity.PsbaGtWjglbService;
import vip.xiaonuo.smzq.modular.lifecycle.service.factory.produce.WrapperMeter;
import vip.xiaonuo.smzq.modular.lifecycle.vo.QueryMineStoreVO;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * <ul>
 * <li>name:  外部调用实现</li>
 * <li>author name: GEOSCENE_YUYANFEI</li>
 * <li>create time: 2024-03-20 15:31:25</li>
 * </ul>
 */
@Service(WrapperMeter.comWrapperMeterServiceName)
public class ComWrapperMeterImpl implements WrapperMeter {

    @Autowired
    PsbaGtWjglbService psbaGtWjglbService;


    @Override
    public List<QueryMineStoreVO> wrapper(List<QueryMineStoreVO> allQueryMinStoreVOS) {
        return null;
    }

    @Override
    public List<String> getWithOutFileIds(List<QueryMineStoreVO> allQueryMinStoreVOS) {
        Set<QueryMineStoreVO> woSet = allQueryMinStoreVOS.stream().filter(ele->CollUtil.isEmpty(ele.getKclWjglbList())).collect(Collectors.toSet());
        List<String> woFileIds = woSet.stream().map(ele->ele.getFileId()).collect(Collectors.toList());
        return woFileIds;
    }

    @Override
    public <T> List<KclWjglb> tranKWB(List<T> list) {
        return BeanUtil.copyToList(list,KclWjglb.class);
    }


}


